#!/bin/bash 
echo "Performing gammaImager simulations..."

mydate1="$(date )"
echo $mydate1

declare -i begin=0
declare -i end=10
declare -i i=$begin
declare -i cycle=10
declare -i check=$cycle

make

while [ $i -lt $end ]
do
     
    i=$[i+1]

    if [ $i -eq $check ]
    then
	check=$[check+cycle]
	nice ./bin/Darwin-g++/imager 
	#say starting new batch of gamma imager simulations
    else
	nice ./bin/Darwin-g++/imager &
    fi

    sleep 5

done

say gamma imager simulations complete

echo " "
echo "Start time:"
echo $mydate1
echo " "
echo "End time:"
date
echo " "

# --------------------------------------------------------------------------
